!function() {
    getApp();
    var t = require("../../../utils/http.js");
    Page({
        data: {
            systemBarHeight: 20,
            navigationBarHeight: 40,
            hbList: [ {
                face: "../../static/image/face.jpg",
                tel: "快开始推广吧",
                type: "暂未寄件",
                price: "",
                status: 0,
                id: 0
            } ],
            ruleShow: !1,
            ruleTxt: "获取中",
            hbShow: !1,
            hbType: 1,
            price: "0.01",
            redBagTitle: "您可在个人中心提现或寄件时使用"
        },
        openRule() {
            this.setData({
                ruleShow: !0
            });
        },
        closeRule() {
            this.setData({
                ruleShow: !1
            });
        },
        closeHb() {
            this.setData({
                hbShow: !1
            }), this.onLoad();
        },
        onLoad: function(t) {
            wx.getSystemInfo({
                success: t => {
                    this.system = t;
                }
            });
            var e = wx.getStorageSync("userId");
            console.log(e), this.menu = wx.getMenuButtonBoundingClientRect(), this.systemBar = this.system.statusBarHeight, 
            this.navigationBar = 2 * (this.menu.top - this.system.statusBarHeight) + this.menu.height, 
            this.setData({
                systemBarHeight: this.systemBar,
                navigationBarHeight: this.navigationBar
            });
        },
        onReady: function() {
            wx.getStorageSync("userId") || wx.showToast({
                title: "请先登陆",
                icon: "none"
            });
        },
        onShow: function() {
            var e = this, 
            i = wx.getStorageSync("userId");

            console.log('======================',e);

            i || (wx.showToast({
                title: "请先登陆",
                icon: "none"
            }), setTimeout(function() {
                wx.redirectTo({
                    url: "/pages/login/login"
                });
            }, 2e3)), t.post("/app/sinvite/rules", {
                userId: i
            }, !1, function(t) {
                t && e.setData({
                    ruleTxt: t
                });
            }), i && t.post("/app/sinvite/lists", {
                userId: i
            }, !1, function(t) {
                t && e.setData({
                    hbList: t
                });
            });
        },
        onHide: function() {},
        onUnload: function() {},
        onPullDownRefresh: function() {},
        onReachBottom: function() {},
        onShareAppMessage: function() {},
        getRedbag: function(e) {
            var i = e.currentTarget.dataset.id, s = this;
            t.post("/app/sinvite/redbag", {
                id: i
            }, !1, function(t) {
                t && s.setData({
                    price: t.price,
                    redBagTitle: t.title,
                    hbShow: !0
                });
            });
        }
    });
}();